﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using Emoney.DataAccess;
using LiuYan.Base;
using LiuYan.Entity;


namespace LiuYan.Service
{
    public class AboutService
    {
        public int Edit(TB_Base entity)
        {
            SqlParameter[] parameters=new SqlParameter[]
            {
                new SqlParameter("@Id",SqlDbType.Int),
                new SqlParameter("@Content",SqlDbType.Text), 
            };
            parameters[0].Value = entity.Id;
            parameters[1].Value = entity.Content;
            string sql = "update tb_base set content=@Content where id=@Id";
            return SqlHelper.ExecuteNonQuery(Connection.conStr, CommandType.Text, sql, parameters);
        }

        public DataTable GetList(int id)
        {
            string sql = "select * from tb_base where id=" + id;
            return SqlHelper.ExecuteDataset(Connection.conStr, CommandType.Text, sql).Tables[0];
        }

    }
}
